package kevin.workplan.service;

import java.util.List;

import kevin.workplan.database.gen.model.Plan;
import kevin.workplan.database.gen.model.PlanExample;
import kevin.workplan.database.gen.model.Projects;
import kevin.workplan.exception.BusinessException;
import kevin.workplan.exception.ServiceException;

public interface PlanService {

	/** 
	 * 创建计划
	 * @param plan
	 */
	void createPlan(Plan plan) throws BusinessException, ServiceException;

	/** 
	 * 编辑计划
	 * @param plan
	 */
	void editPlan(Plan plan) throws BusinessException, ServiceException;


	/**
	 * 搜索总数
	 * @param plan
	 * @param showComplete 是否显示已完成的计划
	 * @return
	 */
	int searchCount(PlanExample px) throws BusinessException, ServiceException;
	/**
	 * 搜索
	 * @param plan
	 * @param showComplete 是否显示已完成的计划
	 * @return
	 * @throws BusinessException
	 * @throws ServiceException
	 */
	List<Plan> search(PlanExample px, int curpage, int limit, String orderBy)
			throws BusinessException, ServiceException;

	/**
	 * 根据主键取
	 * @param id
	 * @return
	 * @throws BusinessException
	 * @throws ServiceException
	 */
	Plan getById(Long id) throws BusinessException, ServiceException;

	/**
	 * 获取用户的项目分类
	 * @param uid
	 * @param type 1大项目，2小项目
	 */
	List<Projects> getProjects(Long uid, int type) throws BusinessException, ServiceException;
	
	/**
	 * 根据父id，获取用户的项目分类
	 * @param uid
	 * @param pid
	 * @return
	 * @throws BusinessException
	 * @throws ServiceException
	 */
	List<Projects> getChildProjects(Long uid, long pid) throws BusinessException, ServiceException;

}
